// 路由配置

export default{
  routes: [
    {
      path: '/home', // 首页
      name: 'home',
      component: resolve => {
        require.ensure(['./src/page/home/index.vue'], () =>{
          resolve(require('./src/page/home/index.vue'))
        })
      }
    },
    {
      path: '/school/open/:id?', // 开通学校
      name: 'schoolOpen',
      component: resolve => {
        require.ensure(['./src/page/school/open.vue'], () =>{
          resolve(require('./src/page/school/open.vue'))
        })
      }
    },
    {
      path: '/school/search', // 学校查询
      name: 'schoolSearch',
      component: resolve => {
        require.ensure(['./src/page/school/search.vue'], () =>{
          resolve(require('./src/page/school/search.vue'))
        })
      }
    },
    {
      path: '/evaluate/factor', // 因素管理
      name: 'factor',
      component: resolve => {
        require.ensure(['./src/page/evaluate/factor.vue'], () =>{
          resolve(require('./src/page/evaluate/factor.vue'))
        })
      }
    },
    {
      path: '/evaluate/factorAdd', // 因素管理
      name: 'factorAdd',
      component: resolve => {
        require.ensure(['./src/page/evaluate/factorAdd.vue'], () =>{
          resolve(require('./src/page/evaluate/factorAdd.vue'))
        })
      }
    },
    // 重定向
    {
      path: '/*',
      redirect: '/home'
    }
  ]
}
